from _keys import YOUR_USERID,YOUR_APIKEY

CHARACTER = "Dew Black"

from api import eveapi,cache

ctx=eveapi.EVEAPIConnection(cacheHandler=cache.CacheHandler()).auth(userID=YOUR_USERID, apiKey=YOUR_APIKEY)

print 'Characters:'
for n,char in enumerate(ctx.account.Characters().characters):
    if char.name==CHARACTER:
        print '    %d) %-20s [#%s] *SELECTED*'%(n,char.name,char.characterID)
        SelectedID=char.characterID
    else:
        print '    %d) %-20s [#%s]'%(n,char.name,char.characterID)
print '--'


chctx=ctx.char
chctx.parameters['characterID']=SelectedID

print chctx.MailMessages()